﻿<%@ Page Title="..:: VMS ::.." Language="C#" MasterPageFile="~/MainMaster.Master" AutoEventWireup="true" CodeBehind="UnitCodeMaster.aspx.cs" Inherits="VMS_Web.UnitCodeMaster" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
   
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">

    <div class="panel panel-default">

        <div class="panel-heading">
            <h3 class="panel-title">Unit Code Master</h3>
            </div>
            <div class="panel-body">
              
                <div class="form-horizontal col-md-5">
                <div class="form-group">
                    <span class="col-md-5">Unit Code</span>
                    <div class="col-md-4">
                        <input type="text" class="form-control" id="txtunitcode" placeholder="Enter Unit code" runat="server" />
                    </div>
                    </div>
                       <div class="form-group">
                     <span class="col-md-5">Description</span>
                    <div class="col-md-4">
                        <input type="text" class="form-control" id="txtunitcodedesc" placeholder="Enter Description" runat="server" />
                    </div>
                            </div>
                       
                    
                        <div class="form-group">
                                        <span class="col-md-5">Is Custom Unit</span>
                                        <div class="col-md-4">
                                            
                                            <asp:CheckBox ID="chkcustomunit" AutoPostBack="true" CssClass="form-control" runat="server" OnCheckedChanged="chkcustomunit_CheckedChanged"></asp:CheckBox>
                                        </div>
                                    </div>

                    <div class="form-group">
                   
                     <span class="col-md-5">Ref Unit Code</span>
                    <div class="col-md-4">
                        <asp:DropDownList ID="ddlrefunitcode" runat="server" CssClass="form-control" Enabled="false"  >
                            
                              
                        </asp:DropDownList>
                    </div>
                            </div>
                     

                       <div class="form-group">
                   
                     <span class="col-md-5">Minmum Hours</span>
                    <div class="col-md-4">
                        <input type="text" class="form-control" id="txtminhours" placeholder="Enter Minimum Hours" runat="server" maxlength="4" />
                    </div>
                            </div>
                       <div class="form-group">
                   
                     <span  class="col-md-5">Maximum Hours</span>
                    <div class="col-md-4">
                        <input type="text" class="form-control" id="txtmaxhours" placeholder="Enter Maximum hours" runat="server" maxlength="4" />
                    </div>
                </div>
                
                <div class="well well-sm">
                    <button id="btnAction" value="Add" class="btn btn-default" runat="server" onserverclick="btnAction_ServerClick" />
                    <button id="btnCancel" type="reset" class="btn btn-default" runat="server" onserverclick="btnCancel_ServerClick" >Cancel</button>
                </div>
            </div>

                  <div class="form-horizontal col-md-7">
                    <div class="control-group">
                    <asp:DataGrid ID="grdunitcodemasterdetails" CssClass="table table-condensed" runat="server" AutoGenerateColumns="false" AllowPaging="true" PageSize="10">
                        <Columns>
                            <asp:BoundColumn DataField="Unit_Code" ReadOnly="True" HeaderText="Unit Code" />
                            <asp:BoundColumn DataField="Desc" ReadOnly="True" HeaderText="Description" ItemStyle-Wrap="false" />
                            
                            <asp:TemplateColumn HeaderText="Custom Unit">
                                <ItemTemplate>
                                    <asp:CheckBox ID="CheckBox1" runat="server" Enabled="false"   Checked='<%#bool.Parse(Eval("IsCustomUnit").ToString())%>' />
                                </ItemTemplate>
                            </asp:TemplateColumn> 

                            <asp:BoundColumn DataField="Min_Hours" ReadOnly="True" HeaderText="Min Hours" />
                            <asp:BoundColumn DataField="Max_Hours" ReadOnly="True" HeaderText="Max Hours" />
                            
                            <asp:TemplateColumn HeaderText="Edit">
                                <ItemTemplate>
                                    <a class="btn btn-default btn-sm" href='<%#RedirectForEdit(Eval("Unit_Code").ToString())%>'><i class="glyphicon glyphicon-edit"></i></a>
                                </ItemTemplate>
                            </asp:TemplateColumn>

                            <asp:TemplateColumn HeaderText="Delete">
                                <ItemTemplate>
                                    <a class="btn btn-default btn-sm" href='<%#RedirectForDelete(Eval("Unit_Code").ToString())%>'><i class="glyphicon glyphicon-remove"></i></a>
                                </ItemTemplate>
                            </asp:TemplateColumn>

                            <%--<asp:TemplateColumn HeaderText="View">
                                <ItemTemplate>
                                    <a class="btn btn-default btn-sm" href="javascript:window.open('ViewUnitCodeDetails.aspx?Type=<%#Eval("Unit_Code").ToString()%>','Master Items Window','width=400,height=350')"><i class="glyphicon glyphicon-open"></i></a>
                                </ItemTemplate>
                            </asp:TemplateColumn>--%>

                        </Columns>
                    </asp:DataGrid>

                    </div>
                </div>
            </div>
        
    </div>
    
   </asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="OnlyForJavaScript" runat="server">
   
     
</asp:Content>
